function drag(ev) {
    ev.dataTransfer.setData("sourceId", ev.target.id);

}


function allowDrop(ev) {
    ev.preventDefault(); /*阻止默认行为*/
}


function drop(ev){
    ev.preventDefault();
    /**判断放置的数字是否是奇数或者偶数*/
    var sourceId = ev.dataTransfer.getData("sourceId");
    var sourceElement = document.getElementById(sourceId);
    var targetElement =   ev.target;
    var num = parseInt(sourceElement.innerText);
    if(isEven(num)){

        if(targetElement.id=="oddBox"){
            sourceElement.classList.add('danger');
        }
        if(targetElement.id=="evenBox"){
            sourceElement.classList.remove('danger');
        }
    }else {
        if(targetElement.id=="evenBox"){
            sourceElement.classList.add('danger');
        }
        if(targetElement.id=="oddBox"){
            sourceElement.classList.remove('danger');
        }
    }

    targetElement.append(sourceElement)
}